#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
获取健康检查端点的完整响应
"""

import requests
import json

def main():
    """主函数"""
    print("获取健康检查完整响应...")
    
    try:
        # 发送请求到健康检查端点
        response = requests.get("http://127.0.0.1:5000/health", timeout=10)
        
        print(f"状态码: {response.status_code}")
        print(f"响应头: {json.dumps(dict(response.headers), indent=2)}")
        
        # 尝试解析JSON响应
        try:
            if response.text.strip():
                json_data = response.json()
                print(f"\n完整JSON响应:\n{json.dumps(json_data, indent=2, ensure_ascii=False)}")
            else:
                print("\n响应内容: 空")
        except Exception as e:
            print(f"\n无法解析JSON: {str(e)}")
            print(f"原始响应内容: {response.text}")
            
    except Exception as e:
        print(f"请求错误: {str(e)}")

if __name__ == "__main__":
    main()